package com.faya.green.service.impl;

import com.faya.green.dao.authority.PostUserDao;
import com.faya.green.model.Post;
import com.faya.green.model.PostUser;
import com.faya.green.service.PostUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户 ：LX
 * 创建时间： 2018/8/19. 22:27
 * 地点：广州
 * 目的: 岗位与用户关系
 * 结果：
 */
@Service
public class PostUserServiceImpl implements PostUserService {

    //压制全部警告
    @SuppressWarnings("all")
    @Autowired
    private PostUserDao postUserDao;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void addPostUser(PostUser postUser) {
        postUserDao.addPostUser(postUser);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updatePostUser(PostUser postUser) {
        postUserDao.updatePostUser(postUser);
    }

    @Override
    public List<Post> getPostByUserId(String userId) {
        return postUserDao.getPostByUserId(userId);
    }
}
